mysql = require 'mysql'

pool = mysql.createPool({
  connectionLimit : 10,
  host: 'zwytestdata.mysql.rds.aliyuncs.com',
  user: 'zwyuser_tw_show',
  password:'zwy123_tw_show',
  database:'zwydata_tw_show'
}

)
###
pool.query 'select 1+1 as solution',(err,rows,fiels)->
  if err
    throw err
  console.log 'the solution is',rows[0].solution



pool.getConnection (err,connection)->
  if err
    console.err 'not connected'
  connection.query 'select 1+1 as sum',(err,rows)->
    if err
      console.err 'no data',err
    console.log rowsd
    connection.release()
###
pool.query 'select * from zy_role limit 5',{name:22,id:33},(err,rows,fields)->
  if err
    throw err
  console.log 'rows:',rows
  console.log 'fiels:',fields